4.0: shared DeallocTestsCore target (step 1 of the 4.0 plan) - #22
Open
DanielCech wants to merge 1 commit into
Open
DanielCech wants to merge 1 commit into
DanielCech wants to merge 1 commit into
Conversation
Moves the framework-independent parts out of DeallocTests: readable type names, leak hints, the leak report formatting and polling. Core imports neither XCTest nor Swift Testing and has no classes, so the upcoming DeallocWatcher product can share it with apps. CI checks both rules. No behaviour change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The 4.0 plan adds a second product, DeallocWatcher, that apps link in Debug builds to catch leaks LeakCanary-style. It needs the same hint and report engine as the tests, but apps must never link XCTest or Swift Testing. So the shared parts move into an internal target first.
What changes
DeallocTestsCore(not a product) with:TypeNames)LeakHints)LeakReport, previouslyDeallocationTracker.leakMessage)Polling.waitUntil), now shared by the deallocation check and the UIKit lifecycle waitspackageaccess, so the public API is unchanged.import XCTest/import Testing, because apps will link it through DeallocWatcher;DeallocTestsCoreTests(6 tests).No behaviour change: messages, timing and API are the same.
Tests
swift test(default traits and--disable-default-traits): all existing tests plus the 6 Core tests pass.🤖 Generated with Claude Code